package com.yicong.ants.bean.video;

import com.chad.library.adapter.base.entity.MultiItemEntity;
import com.yicong.ants.ui.video.CommentEntity;

import java.util.ArrayList;
import java.util.List;

/**
 * @author ganhuanhui
 * 时间：2019/12/11 0011
 * 描述：
 */
public class FirstLevelBean implements MultiItemEntity {

    List<SecondLevelBean> secondLevelBeans;

    //一级评论id
    String id;
    //一级评论头像
    String headImg;
    //一级评论的用户名
    String userName;
    //一级评论的用户id
    String userId;
    //评论内容
    String content;
    //创建时间
    String createTime;
    //点赞数量
    long likeCount;
    //是否点赞了  0没有 1点赞
    boolean is_like;
    //当前评论的总条数（包括这条一级评论）ps:处于未使用状态
    int totalCount;
    //当前一级评论的位置（下标）
    int position;
    //当前一级评论所在的位置(下标)
    int positionCount;
    //回复数量
    int replyCount;
    //回复数量
    boolean enable = true;

    public FirstLevelBean() {
    }

    public List<SecondLevelBean> getSecondLevelBeans() {
        return secondLevelBeans == null ? new ArrayList<>() : secondLevelBeans;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"secondLevelBeans\":")
            .append(secondLevelBeans);
        sb.append(",\"id\":\"")
            .append(id).append('\"');
        sb.append(",\"headImg\":\"")
            .append(headImg).append('\"');
        sb.append(",\"userName\":\"")
            .append(userName).append('\"');
        sb.append(",\"userId\":\"")
            .append(userId).append('\"');
        sb.append(",\"content\":\"")
            .append(content).append('\"');
        sb.append(",\"createTime\":")
            .append(createTime);
        sb.append(",\"likeCount\":")
            .append(likeCount);
        sb.append(",\"isLike\":")
            .append(is_like);
        sb.append(",\"totalCount\":")
            .append(totalCount);
        sb.append(",\"position\":")
            .append(position);
        sb.append(",\"positionCount\":")
            .append(positionCount);
        sb.append('}');
        return sb.toString();
    }

    @Override
    public int getItemType() {
        return CommentEntity.TYPE_COMMENT_PARENT;
    }

    public String getId() {
        return this.id;
    }

    public String getHeadImg() {
        return this.headImg;
    }

    public String getUserName() {
        return this.userName;
    }

    public String getUserId() {
        return this.userId;
    }

    public String getContent() {
        return this.content;
    }

    public String getCreateTime() {
        return this.createTime;
    }

    public long getLikeCount() {
        return this.likeCount;
    }

    public boolean is_like() {
        return this.is_like;
    }

    public int getTotalCount() {
        return this.totalCount;
    }

    public int getPosition() {
        return this.position;
    }

    public int getPositionCount() {
        return this.positionCount;
    }

    public int getReplyCount() {
        return this.replyCount;
    }

    public boolean isEnable() {
        return this.enable;
    }

    public void setSecondLevelBeans(List<SecondLevelBean> secondLevelBeans) {
        this.secondLevelBeans = secondLevelBeans;
    }

    public void setId(String id) {
        this.id = id;
    }

    public void setHeadImg(String headImg) {
        this.headImg = headImg;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public void setLikeCount(long likeCount) {
        this.likeCount = likeCount;
    }

    public void set_like(boolean is_like) {
        this.is_like = is_like;
    }

    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
    }

    public void setPosition(int position) {
        this.position = position;
    }

    public void setPositionCount(int positionCount) {
        this.positionCount = positionCount;
    }

    public void setReplyCount(int replyCount) {
        this.replyCount = replyCount;
    }

    public void setEnable(boolean enable) {
        this.enable = enable;
    }

    public boolean equals(final Object o) {
        if (o == this) return true;
        if (!(o instanceof FirstLevelBean)) return false;
        final FirstLevelBean other = (FirstLevelBean) o;
        if (!other.canEqual((Object) this)) return false;
        final Object this$secondLevelBeans = this.getSecondLevelBeans();
        final Object other$secondLevelBeans = other.getSecondLevelBeans();
        if (this$secondLevelBeans == null ? other$secondLevelBeans != null : !this$secondLevelBeans.equals(other$secondLevelBeans))
            return false;
        final Object this$id = this.getId();
        final Object other$id = other.getId();
        if (this$id == null ? other$id != null : !this$id.equals(other$id)) return false;
        final Object this$headImg = this.getHeadImg();
        final Object other$headImg = other.getHeadImg();
        if (this$headImg == null ? other$headImg != null : !this$headImg.equals(other$headImg))
            return false;
        final Object this$userName = this.getUserName();
        final Object other$userName = other.getUserName();
        if (this$userName == null ? other$userName != null : !this$userName.equals(other$userName))
            return false;
        final Object this$userId = this.getUserId();
        final Object other$userId = other.getUserId();
        if (this$userId == null ? other$userId != null : !this$userId.equals(other$userId))
            return false;
        final Object this$content = this.getContent();
        final Object other$content = other.getContent();
        if (this$content == null ? other$content != null : !this$content.equals(other$content))
            return false;
        final Object this$createTime = this.getCreateTime();
        final Object other$createTime = other.getCreateTime();
        if (this$createTime == null ? other$createTime != null : !this$createTime.equals(other$createTime))
            return false;
        if (this.getLikeCount() != other.getLikeCount()) return false;
        if (this.is_like() != other.is_like()) return false;
        if (this.getTotalCount() != other.getTotalCount()) return false;
        if (this.getPosition() != other.getPosition()) return false;
        if (this.getPositionCount() != other.getPositionCount()) return false;
        if (this.getReplyCount() != other.getReplyCount()) return false;
        if (this.isEnable() != other.isEnable()) return false;
        return true;
    }

    protected boolean canEqual(final Object other) {
        return other instanceof FirstLevelBean;
    }

    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final Object $secondLevelBeans = this.getSecondLevelBeans();
        result = result * PRIME + ($secondLevelBeans == null ? 43 : $secondLevelBeans.hashCode());
        final Object $id = this.getId();
        result = result * PRIME + ($id == null ? 43 : $id.hashCode());
        final Object $headImg = this.getHeadImg();
        result = result * PRIME + ($headImg == null ? 43 : $headImg.hashCode());
        final Object $userName = this.getUserName();
        result = result * PRIME + ($userName == null ? 43 : $userName.hashCode());
        final Object $userId = this.getUserId();
        result = result * PRIME + ($userId == null ? 43 : $userId.hashCode());
        final Object $content = this.getContent();
        result = result * PRIME + ($content == null ? 43 : $content.hashCode());
        final Object $createTime = this.getCreateTime();
        result = result * PRIME + ($createTime == null ? 43 : $createTime.hashCode());
        final long $likeCount = this.getLikeCount();
        result = result * PRIME + (int) ($likeCount >>> 32 ^ $likeCount);
        result = result * PRIME + (this.is_like() ? 79 : 97);
        result = result * PRIME + this.getTotalCount();
        result = result * PRIME + this.getPosition();
        result = result * PRIME + this.getPositionCount();
        result = result * PRIME + this.getReplyCount();
        result = result * PRIME + (this.isEnable() ? 79 : 97);
        return result;
    }
}
